﻿using System;

using mvcForum.Core;
using mvcForum.Core.Interfaces;
using mvcForum.Core.Interfaces.Data;

namespace mvcForum.SearchProvider.Lucene {

	public class LuceneInstall : IInstallable {
		private readonly IRepository<AddOnConfiguration> configRepo;

		public LuceneInstall(IRepository<AddOnConfiguration> configRepo) {
			this.configRepo = configRepo;
		}

		public void Install() {
			LuceneConfiguration config = new LuceneConfiguration(this.configRepo);
			config.Enabled = true;
			config.RunAsynchronously = false;
			config.Delay = 15;
			config.AnnouncementWeight = 400;
			config.StickyWeight = 300;
			config.TitleWeight = 200;
			config.TopicWeight = 200;
		}
	}
}